﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CivilRegistry.Common;

namespace CivilRegistry.UserControls
{
    public partial class UCUserGadget : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (SessionHandler.CurrentSession.User != null)
                {
                    ControlledModel.User loggedInUser = SessionHandler.CurrentSession.User;
                    imgProfileImage.ImageUrl = @"~\" + loggedInUser.GetProfileImagePath().Replace(Request.ServerVariables["APPL_PHYSICAL_PATH"], String.Empty) + "?=" + DateTime.Now;
                    lblUserIdValue.Text = loggedInUser.UserId.ToString();
                    lblUserNameValue.Text = loggedInUser.UserName;
                    lblFirstNameValue.Text = loggedInUser.FirstName;
                    lblMiddleNameValue.Text = loggedInUser.MiddleName;
                    lblLastNameValue.Text = loggedInUser.LastName;
                }
            }
        }
    }
}